const initData = {
    list: [],
    i: 0,
    dataList: []
}

const dataReducer = (state = initData, { type, payload }) => {

    switch(type) {

        case 'GET_LIST':
            return {
                ...state,
                list: payload
            }

        case 'CLICK_BTN':
            return {
                ...state,
                i: payload
            }

        case 'DATA_LIST':
            return {
                ...state,
                dataList: payload
            }
            
        default:
            return {
                ...state
            }
    }

}

export default dataReducer